home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-3557 / news.txt / pound.asc < prev    next >
Text File  |  1997-06-21  |  10KB  |  187 lines

  1.  
  2.  
  3.                          °∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙
  4.                          ∙  THE ELUSIVE £ SIGN  ∙
  5.                          ∙                      ∙
  6.                          ∙   by Martyn Dryden   ∙
  7.                          ∙                      ∙
  8.                          °∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙°∙
  9.  
  10.  
  11.   It seems somehow appropriate that just as actual pounds sterling can  be 
  12. difficult  to  obtain in real life,  so the £ symbol can be  difficult  to 
  13. print in the world of computing.   I can't help you with obtaining  pounds 
  14. sterling,  but  the printing of the £ symbol is one of the  problems  most 
  15. commonly  encountered  in queries from users.   If this is  your  problem, 
  16. then read on.
  17.  
  18.   First  a little  background.   The  Atari ST can  normally  display  256 
  19. different characters on screen (including blanks) and we number them 0  to 
  20. 255 in decimal numbers,  or $00 to $FF in hex (decimal 15 = hex  $0F).  Of 
  21. these,  the characters from 32 to 128 ($20 to $7F) are standardised across 
  22. all  computers  and printers,  and are known as the  ASCII  character  set 
  23. (American Standard Code for Information Interchange).
  24.  
  25.   Difficulties  with the  pound sign arise from the fact that  it  doesn't 
  26. form  part of the standard ASCII set.   The second 128 characters ($80  to 
  27. $FF)  are not standardised,  and manufacturers have assigned them in  many 
  28. different ways.
  29.  
  30.   If  you  inspect  the ST's character set  (displayed  in  the  FirstWord  
  31. program,  for  example),  you will see the £ sign at position $9C (156  in 
  32. real money).   The £ sign may be character $9C on your  printer,  too,  in 
  33. which  case  you may be wondering what all the fuss is  about.   But  your 
  34. printer  may  have a different character set (many printers  have  several 
  35. alternative sets,  selected either in software or by DIP switch, or both).    
  36. Your  printer's  character $9C could equally well be  a  Greek  letter,  a 
  37. graphic symbol,  or a blank,  in which case that is what you will get when 
  38. you try to print a pound sign.
  39.  
  40.   The  pound sign on  your printer may be at character $9C in one  of  its 
  41. character  sets - in fact,  if your printer supports IBM Character Set  No 
  42. 2,  then that's where you will find it.   In this case,  to print a £  you 
  43. must first activate IBM Character Set 2.   Once this is done,  sending a £ 
  44. ($9C) from your wordprocessor will print a £.  (See Method 1, below.)
  45.  
  46.   Another popular location is $86 (134 decimal) in the standard  character 
  47. set.   In  this  case,  to print a £ you just need to make  your  WP  send 
  48. character number $86 instead of $9C.  (See Method 2, below.)
  49.  
  50.   Printers also offer a choice of national language character  sets.   The 
  51. national language character set is a small sub-set of characters,  usually 
  52. 12,  which  can be varied.   The pound sign is one of  these:   it  shares 
  53. character  number  35 ($23 hex) with the # sign (usually known as  a  hash 
  54. sign,  although  in  the USA confusingly called a pound  sign).   In  this 
  55. case,  to print a £ you must first activate the UK national character set.  
  56. Once this is done,  sending a # ($23) from your wordprocessor will print a 
  57. £.  (See Method 3, below.)
  58.  
  59.   Your printer's  manual will contain a listing or table showing  all  the 
  60. characters that it can print,  in its various character sets,  along  with 
  61. their codes (0 to 256).   Different printers have very different capabili-
  62. ties.    Some  may  have  several  different  alternative  character  sets 
  63. (sometimes known as code pages).   At the other extreme,  outdated  and/or 
  64. low  cost  printers may only have characters up to number  127,  in  which 
  65. case  characters  above  128 may be bold or italic versions  of  the  same 
  66. characters.
  67.  
  68.   You can switch between character sets,  if necessary, either by software 
  69. (sending  the  necessary control codes to the printer) or by  DIP  switch. 
  70. Instructions will be in the printer manual.   Unfortunately, these manuals 
  71. are rarely models of clarity.
  72.  
  73.  
  74.                                  Method 1
  75.                                  °∙°∙°∙°∙
  76.   Activate the character set in  which the £ sign is character number  $9C 
  77. - frequently described as IBM Character Set 2.
  78.  
  79.   With  most  printers,  there  is  no method of  selecting  IBM  mode  in 
  80. software:   it is a DIP switch selection,  an alternative to the printer's 
  81. default  mode.   However,  since the majority of software supports an  IBM 
  82. printer, leaving your printer in this mode shouldn't cause any problems.
  83.  
  84.   Once in IBM mode,  the selection of  Character Set 2 can be done  either 
  85. in  software  (by sending control codes) or by DIP  switch.   The  control 
  86. codes  are normally given in the manual as ESC "6" ($1B,  $36)  to  select 
  87. character set 2, and ESC "7" ($1B, $37) to revert to character set 1.
  88.  
  89.   You will almost certainly  be staying with character set 2,  as it's  by 
  90. far  the  more  useful character set.   It's simplest to  use  DIP  switch 
  91. selection.   Alternatively  you  can make your WP select character  set  2 
  92. when it starts up, by including ESC "6" in the initialisation sequence.
  93.  
  94.  
  95.                                  Method 2
  96.                                  °∙°∙°∙°∙
  97.  
  98.   To make your WP send character number $86 instead of $9C,  you will need 
  99. to  adjust  the printer driver.   The way to do this depends on  which  WP 
  100. you're using.   Assuming that a commercial WP comes with full instructions 
  101. (or,  preferably,  a pre-set driver for your printer),  let's look at  the 
  102. two  favourite free WPs,  FirstWord and STWriter.     
  103.  
  104.   For  FirstWord (and indeed FirstWord Plus),  you have to edit  the  .HEX 
  105. file,  a  text file containing the printer control codes expressed as  hex 
  106. numbers.   You then run the INSTALL.PRG on the edited .HEX file, to create 
  107. a  small  file  called 1ST_PRNT.DOT (or  1ST_PRNT.DSY  for  a  daisy-wheel 
  108. printer).  This file will be read by the program when you start to print.
  109.  
  110.   The .HEX  file normally contains plenty of comments which will help  you 
  111. navigate through it.   Your aim is to create (or modify) entry $9C in  the 
  112. 'character substitution table',  which is the last part of the file. These 
  113. entries must be in numerical order,  but they don't all have to exist,  so 
  114. make  sure  you  insert the entry in the right place  if  it  isn't  there 
  115. already.
  116.  
  117.   The entry consists of:
  118.  
  119.   9C, 86  * char $86 is a pound sign on my printer
  120.  
  121.   viz:   the character you want to replace,  the  character with which  to 
  122. replace it, and a comment to remind yourself what you did and why.
  123.  
  124.   Do not forget to save your file in non-WP mode (the WP mode item in  the 
  125. Edit menu must NOT be ticked).
  126.  
  127.   With STWriter,  the idea is similar:   you edit the file CONFIG.TXT, and 
  128. then  run  the program CONFIG.TOS,  which creates a  data  file  XYZZX.DAT 
  129. (don't  ask!).   The main difference is that in FirstWord the entries  are 
  130. optional  and  can be any length,  but STWriter requires them  all  to  be 
  131. present,  and only one character long.   You must therefore find the $9Cth 
  132. (156th) entry in the substitution table and replace it with $86.
  133.  
  134.  
  135.                                  Method 3
  136.                                  °∙°∙°∙°∙
  137.  
  138.   Activate the  UK national character set,  and then send a #  ($23)  from 
  139. your wordprocessor.
  140.  
  141.   You  can  select the character set using  DIP switches,  and  then  just  
  142. substitute $23 for character $9C, using the method described above.
  143.  
  144.   However,  in  this case you  will ONLY be able to use the  UK  character 
  145. set.   You won't be able to print a #,  for example,  or any of the  other 
  146. national  replacement characters,  such as European  accented  characters. 
  147. It's more flexible to switch character sets on a per-character basis.
  148.  
  149.   To do so we extend the method described above,  to include the character 
  150. set commands in the printer driver file.  In FirstWord, for example:
  151.  
  152.   9C, 1B, 52, 03, 23 * £ from UK character set
  153.  
  154.   This  means  that  character 9C  is substituted  by  a  string  of  four 
  155. characters:   ESC "R" $03 $23.   The first three of these are the  command 
  156. to select the UK character set:   ESC "R" n,  where n is 3 for the UK. The 
  157. last is the hash symbol.
  158.  
  159.   If you want to be able to print a hash then you need to switch  back  to 
  160. the  US  character set for this character,  and so you will  need  another 
  161. entry (remember to keep them in order!):
  162.  
  163.   23, 1B, 52, 00, 23 * # from US character set
  164.  
  165.   To  get the full benefit of this,  with access to  all of  the  national 
  166. character sets,  you must do the same for the other characters that can be 
  167. replaced in this way.   For example,  activating the French character  set 
  168. and  sending  a  left curly bracket ($7B) produces a  lower  case  e-acute 
  169. ($82).  To organise this, do as follows:
  170.  
  171.   7B, 1B, 52, 00, 7B * left curly bracket from US char set
  172.   82, 1B, 52, 01, 7B * e acute from French character set
  173.  
  174.   By spending a few hours poring over your  printer  manual,  editing  the 
  175. .HEX file and running it through the INSTALL program,  with a little  luck 
  176. you  will find that you can print every character that you can type -  all 
  177. 256  of  them.   No more embarrassing blanks or mysterious  characters  in 
  178. your documents! 
  179.  
  180.   Just  as important,  you'll have learned a good deal about your  printer 
  181. and how to get the most from it,  profiting from your investment and happy 
  182. with your hardware.
  183.  
  184.  
  185.  
  186.                               ~~~~~eof~~~~~
  187.